\(\int (b \sec (e+f x))^m \tan ^3(e+f x) \, dx\) [352]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [C] (warning: unable to verify)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [F]
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 19, antiderivative size = 43 \[ \int (b \sec (e+f x))^m \tan ^3(e+f x) \, dx=-\frac {(b \sec (e+f x))^m}{f m}+\frac {(b \sec (e+f x))^{2+m}}{b^2 f (2+m)} \]

[Out]

-(b*sec(f*x+e))^m/f/m+(b*sec(f*x+e))^(2+m)/b^2/f/(2+m)

Rubi [A] (verified)

Time = 0.07 (sec) , antiderivative size = 43, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.105, Rules used = {2686, 14} \[ \int (b \sec (e+f x))^m \tan ^3(e+f x) \, dx=\frac {(b \sec (e+f x))^{m+2}}{b^2 f (m+2)}-\frac {(b \sec (e+f x))^m}{f m} \]

[In]

Int[(b*Sec[e + f*x])^m*Tan[e + f*x]^3,x]

[Out]

-((b*Sec[e + f*x])^m/(f*m)) + (b*Sec[e + f*x])^(2 + m)/(b^2*f*(2 + m))

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 2686

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[a/f, Subst[
Int[(a*x)^(m - 1)*(-1 + x^2)^((n - 1)/2), x], x, Sec[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n -
1)/2] &&  !(IntegerQ[m/2] && LtQ[0, m, n + 1])

Rubi steps \begin{align*} \text {integral}& = \frac {b \text {Subst}\left (\int (b x)^{-1+m} \left (-1+x^2\right ) \, dx,x,\sec (e+f x)\right )}{f} \\ & = \frac {b \text {Subst}\left (\int \left (-(b x)^{-1+m}+\frac {(b x)^{1+m}}{b^2}\right ) \, dx,x,\sec (e+f x)\right )}{f} \\ & = -\frac {(b \sec (e+f x))^m}{f m}+\frac {(b \sec (e+f x))^{2+m}}{b^2 f (2+m)} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.15 (sec) , antiderivative size = 37, normalized size of antiderivative = 0.86 \[ \int (b \sec (e+f x))^m \tan ^3(e+f x) \, dx=-\frac {(b \sec (e+f x))^m \left (2+m-m \sec ^2(e+f x)\right )}{f m (2+m)} \]

[In]

Integrate[(b*Sec[e + f*x])^m*Tan[e + f*x]^3,x]

[Out]

-(((b*Sec[e + f*x])^m*(2 + m - m*Sec[e + f*x]^2))/(f*m*(2 + m)))

Maple [C] (warning: unable to verify)

Result contains higher order function than in optimal. Order 9 vs. order 3.

Time = 2.06 (sec) , antiderivative size = 2423, normalized size of antiderivative = 56.35

method result size
risch \(\text {Expression too large to display}\) \(2423\)

[In]

int((b*sec(f*x+e))^m*tan(f*x+e)^3,x,method=_RETURNVERBOSE)

[Out]

-1/(2+m)/f/(exp(2*I*(f*x+e))+1)^2/m*exp(I*(f*x+e))^m*(exp(2*I*(f*x+e))+1)^(-m)*2^m*b^m*(m*exp(-1/2*I*csgn(I*ex
p(I*(f*x+e))/(exp(2*I*(f*x+e))+1))^3*Pi*m)*exp(1/2*I*csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))^2*csgn(I*exp(
I*(f*x+e)))*Pi*m)*exp(1/2*I*csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))^2*Pi*csgn(I/(exp(2*I*(f*x+e))+1))*m)*e
xp(-1/2*I*csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))*csgn(I*exp(I*(f*x+e)))*Pi*csgn(I/(exp(2*I*(f*x+e))+1))*m
)*exp(1/2*I*csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))*csgn(I*b*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))^2*Pi*m)*
exp(-1/2*I*csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))*csgn(I*b*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))*csgn(I*b)
*Pi*m)*exp(-1/2*I*csgn(I*b*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))^3*Pi*m)*exp(1/2*I*csgn(I*b*exp(I*(f*x+e))/(exp
(2*I*(f*x+e))+1))^2*csgn(I*b)*Pi*m)*exp(4*I*f*x)*exp(4*I*e)+2*exp(-1/2*I*csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e
))+1))^3*Pi*m)*exp(1/2*I*csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))^2*csgn(I*exp(I*(f*x+e)))*Pi*m)*exp(1/2*I*
csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))^2*Pi*csgn(I/(exp(2*I*(f*x+e))+1))*m)*exp(-1/2*I*csgn(I*exp(I*(f*x+
e))/(exp(2*I*(f*x+e))+1))*csgn(I*exp(I*(f*x+e)))*Pi*csgn(I/(exp(2*I*(f*x+e))+1))*m)*exp(1/2*I*csgn(I*exp(I*(f*
x+e))/(exp(2*I*(f*x+e))+1))*csgn(I*b*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))^2*Pi*m)*exp(-1/2*I*csgn(I*exp(I*(f*x
+e))/(exp(2*I*(f*x+e))+1))*csgn(I*b*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))*csgn(I*b)*Pi*m)*exp(-1/2*I*csgn(I*b*e
xp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))^3*Pi*m)*exp(1/2*I*csgn(I*b*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))^2*csgn(I*b
)*Pi*m)*exp(4*I*f*x)*exp(4*I*e)-2*m*exp(-1/2*I*csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))^3*Pi*m)*exp(1/2*I*c
sgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))^2*csgn(I*exp(I*(f*x+e)))*Pi*m)*exp(1/2*I*csgn(I*exp(I*(f*x+e))/(exp
(2*I*(f*x+e))+1))^2*Pi*csgn(I/(exp(2*I*(f*x+e))+1))*m)*exp(-1/2*I*csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))*
csgn(I*exp(I*(f*x+e)))*Pi*csgn(I/(exp(2*I*(f*x+e))+1))*m)*exp(1/2*I*csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1)
)*csgn(I*b*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))^2*Pi*m)*exp(-1/2*I*csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))
*csgn(I*b*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))*csgn(I*b)*Pi*m)*exp(-1/2*I*csgn(I*b*exp(I*(f*x+e))/(exp(2*I*(f*
x+e))+1))^3*Pi*m)*exp(1/2*I*csgn(I*b*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))^2*csgn(I*b)*Pi*m)*exp(2*I*f*x)*exp(2
*I*e)+4*exp(-1/2*I*csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))^3*Pi*m)*exp(1/2*I*csgn(I*exp(I*(f*x+e))/(exp(2*
I*(f*x+e))+1))^2*csgn(I*exp(I*(f*x+e)))*Pi*m)*exp(1/2*I*csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))^2*Pi*csgn(
I/(exp(2*I*(f*x+e))+1))*m)*exp(-1/2*I*csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))*csgn(I*exp(I*(f*x+e)))*Pi*cs
gn(I/(exp(2*I*(f*x+e))+1))*m)*exp(1/2*I*csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))*csgn(I*b*exp(I*(f*x+e))/(e
xp(2*I*(f*x+e))+1))^2*Pi*m)*exp(-1/2*I*csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))*csgn(I*b*exp(I*(f*x+e))/(ex
p(2*I*(f*x+e))+1))*csgn(I*b)*Pi*m)*exp(-1/2*I*csgn(I*b*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))^3*Pi*m)*exp(1/2*I*
csgn(I*b*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))^2*csgn(I*b)*Pi*m)*exp(2*I*f*x)*exp(2*I*e)+m*exp(1/2*I*Pi*m*(-csg
n(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))^3+csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))^2*csgn(I*exp(I*(f*x+e))
)+csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*x+e))+1))-csgn(I*exp(I*(f*x+e))/(exp(2*I*(f
*x+e))+1))*csgn(I*exp(I*(f*x+e)))*csgn(I/(exp(2*I*(f*x+e))+1))+csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))*csg
n(I*b*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))^2-csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))*csgn(I*b*exp(I*(f*x+e
))/(exp(2*I*(f*x+e))+1))*csgn(I*b)-csgn(I*b*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))^3+csgn(I*b*exp(I*(f*x+e))/(ex
p(2*I*(f*x+e))+1))^2*csgn(I*b)))+2*exp(1/2*I*Pi*m*(-csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))^3+csgn(I*exp(I
*(f*x+e))/(exp(2*I*(f*x+e))+1))^2*csgn(I*exp(I*(f*x+e)))+csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))^2*csgn(I/
(exp(2*I*(f*x+e))+1))-csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))*csgn(I*exp(I*(f*x+e)))*csgn(I/(exp(2*I*(f*x+
e))+1))+csgn(I*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))*csgn(I*b*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))^2-csgn(I*exp
(I*(f*x+e))/(exp(2*I*(f*x+e))+1))*csgn(I*b*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))*csgn(I*b)-csgn(I*b*exp(I*(f*x+
e))/(exp(2*I*(f*x+e))+1))^3+csgn(I*b*exp(I*(f*x+e))/(exp(2*I*(f*x+e))+1))^2*csgn(I*b))))

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 50, normalized size of antiderivative = 1.16 \[ \int (b \sec (e+f x))^m \tan ^3(e+f x) \, dx=-\frac {{\left ({\left (m + 2\right )} \cos \left (f x + e\right )^{2} - m\right )} \left (\frac {b}{\cos \left (f x + e\right )}\right )^{m}}{{\left (f m^{2} + 2 \, f m\right )} \cos \left (f x + e\right )^{2}} \]

[In]

integrate((b*sec(f*x+e))^m*tan(f*x+e)^3,x, algorithm="fricas")

[Out]

-((m + 2)*cos(f*x + e)^2 - m)*(b/cos(f*x + e))^m/((f*m^2 + 2*f*m)*cos(f*x + e)^2)

Sympy [F]

\[ \int (b \sec (e+f x))^m \tan ^3(e+f x) \, dx=\begin {cases} x \left (b \sec {\left (e \right )}\right )^{m} \tan ^{3}{\left (e \right )} & \text {for}\: f = 0 \\\frac {\int \frac {\tan ^{3}{\left (e + f x \right )}}{\sec ^{2}{\left (e + f x \right )}}\, dx}{b^{2}} & \text {for}\: m = -2 \\- \frac {\log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {\tan ^{2}{\left (e + f x \right )}}{2 f} & \text {for}\: m = 0 \\\frac {m \left (b \sec {\left (e + f x \right )}\right )^{m} \tan ^{2}{\left (e + f x \right )}}{f m^{2} + 2 f m} - \frac {2 \left (b \sec {\left (e + f x \right )}\right )^{m}}{f m^{2} + 2 f m} & \text {otherwise} \end {cases} \]

[In]

integrate((b*sec(f*x+e))**m*tan(f*x+e)**3,x)

[Out]

Piecewise((x*(b*sec(e))**m*tan(e)**3, Eq(f, 0)), (Integral(tan(e + f*x)**3/sec(e + f*x)**2, x)/b**2, Eq(m, -2)
), (-log(tan(e + f*x)**2 + 1)/(2*f) + tan(e + f*x)**2/(2*f), Eq(m, 0)), (m*(b*sec(e + f*x))**m*tan(e + f*x)**2
/(f*m**2 + 2*f*m) - 2*(b*sec(e + f*x))**m/(f*m**2 + 2*f*m), True))

Maxima [A] (verification not implemented)

none

Time = 0.36 (sec) , antiderivative size = 51, normalized size of antiderivative = 1.19 \[ \int (b \sec (e+f x))^m \tan ^3(e+f x) \, dx=-\frac {\frac {b^{m} \cos \left (f x + e\right )^{-m}}{m} - \frac {b^{m} \cos \left (f x + e\right )^{-m}}{{\left (m + 2\right )} \cos \left (f x + e\right )^{2}}}{f} \]

[In]

integrate((b*sec(f*x+e))^m*tan(f*x+e)^3,x, algorithm="maxima")

[Out]

-(b^m*cos(f*x + e)^(-m)/m - b^m*cos(f*x + e)^(-m)/((m + 2)*cos(f*x + e)^2))/f

Giac [F]

\[ \int (b \sec (e+f x))^m \tan ^3(e+f x) \, dx=\int { \left (b \sec \left (f x + e\right )\right )^{m} \tan \left (f x + e\right )^{3} \,d x } \]

[In]

integrate((b*sec(f*x+e))^m*tan(f*x+e)^3,x, algorithm="giac")

[Out]

integrate((b*sec(f*x + e))^m*tan(f*x + e)^3, x)

Mupad [B] (verification not implemented)

Time = 4.06 (sec) , antiderivative size = 87, normalized size of antiderivative = 2.02 \[ \int (b \sec (e+f x))^m \tan ^3(e+f x) \, dx=-\frac {{\left (\frac {b}{\cos \left (e+f\,x\right )}\right )}^m\,\left (8\,\cos \left (2\,e+2\,f\,x\right )-m+2\,\cos \left (4\,e+4\,f\,x\right )+m\,\cos \left (4\,e+4\,f\,x\right )+6\right )}{f\,m\,\left (m+2\right )\,\left (4\,\cos \left (2\,e+2\,f\,x\right )+\cos \left (4\,e+4\,f\,x\right )+3\right )} \]

[In]

int(tan(e + f*x)^3*(b/cos(e + f*x))^m,x)

[Out]

-((b/cos(e + f*x))^m*(8*cos(2*e + 2*f*x) - m + 2*cos(4*e + 4*f*x) + m*cos(4*e + 4*f*x) + 6))/(f*m*(m + 2)*(4*c
os(2*e + 2*f*x) + cos(4*e + 4*f*x) + 3))